package CCorrection
{
	public class c_corObj extends Object {
		public function c_corObj(cardBody: Object, params: *) {
			super();
			if (cardBody && params) {
				if (cardBody.hasOwnProperty('photos')) {
					for (var i:int=0; i<cardBody.photos.length; i++)
						applyColors(cardBody.photos[i].ct, params, i * 6);
				} else applyColors(cardBody.colorsExt, params);
			}
		}
		
		protected function applyColors(colors: Object, params: Array, offset: int=0): void {
			colors.blueMultiplier 	= parseFloat(params[1 + offset]);
			colors.greenMultiplier 	= parseFloat(params[2 + offset]);
			colors.redMultiplier 	= parseFloat(params[3 + offset]);
			colors.blueOffset 		= parseFloat(params[4 + offset]);
			colors.greenOffset 		= parseFloat(params[5 + offset]);
			colors.redOffset 		= parseFloat(params[6 + offset]);
		}
		
		public function dispose(): void {
		}
	}
}